package com.tiger.ejbql.sample3;

import java.util.*;
import javax.ejb.*;
import javax.naming.*;

public abstract class EJBQLA3Bean implements javax.ejb.EntityBean {
    private javax.ejb.EntityContext entityContext = null;
    
    public abstract void setId(Integer id);
    public abstract Integer getId();
    public abstract void setName(String name);
    public abstract String getName();
    public abstract void setValue(double value);
    public abstract double getValue();
    public abstract void setEjbqlb3(Collection b);
    public abstract Collection getEjbqlb3();
    
    public void ejbHomeTest() {
        try {
            System.out.println("CONCAT�֐�:");
            Iterator concatResults = ejbSelectTestConcat(new Integer(1), new Integer(2)).iterator();
            while(concatResults.hasNext()) {
                EJBQLA3 a1 = (EJBQLA3)concatResults.next();
                System.out.println("id = " + a1.getId() +
                " name = " + a1.getName() +
                " value = " + a1.getValue());
            }
            System.out.println();
            System.out.println("SUBSTRING�֐�:");
            Iterator substringResults = ejbSelectTestSubstring(new Integer(3), 3, 2).iterator();
            while(substringResults.hasNext()) {
                String s = (String)substringResults.next();
                System.out.println("name = " + s);
            }
            System.out.println();
            System.out.println("LOCATE�֐�:");
            Iterator locateResults = ejbSelectTestLocate().iterator();
            while(locateResults.hasNext()) {
                EJBQLA3 a1 = (EJBQLA3)locateResults.next();
                System.out.println("id = " + a1.getId() +
                " name = " + a1.getName() +
                " value = " + a1.getValue());
            }
            System.out.println();
            System.out.println("LENGTH�֐�:");
            Iterator lengthResults = ejbSelectTestLength(2).iterator();
            while(lengthResults.hasNext()) {
                EJBQLA3 a1 = (EJBQLA3)lengthResults.next();
                System.out.println("id = " + a1.getId() +
                " name = " + a1.getName() +
                " value = " + a1.getValue());
            }
            System.out.println();
            System.out.println("ABS�֐�:");
            Iterator absResults = ejbSelectTestAbs(new Integer(4)).iterator();
            while(absResults.hasNext()) {
                EJBQLA3 a1 = (EJBQLA3)absResults.next();
                System.out.println("id = " + a1.getId() +
                " name = " + a1.getName() +
                " value = " + a1.getValue());
            }
            System.out.println();
            System.out.println("SQRT�֐�:");
            Iterator sqrtResults = ejbSelectTestSqrt(new Integer(1)).iterator();
            while(sqrtResults.hasNext()) {
                EJBQLA3 a1 = (EJBQLA3)sqrtResults.next();
                System.out.println("id = " + a1.getId() +
                " name = " + a1.getName() +
                " value = " + a1.getValue());
            }
        }
        catch(javax.ejb.FinderException e) {
            throw new javax.ejb.EJBException(e);
        }
    }
    
    public abstract Collection ejbSelectTestConcat(Integer id1, Integer id2)
    throws javax.ejb.FinderException;
    public abstract Set ejbSelectTestSubstring(Integer id, int start, int length)
    throws javax.ejb.FinderException;
    public abstract Collection ejbSelectTestLocate()
    throws javax.ejb.FinderException;
    public abstract Collection ejbSelectTestLength(int length)
    throws javax.ejb.FinderException;
    public abstract Set ejbSelectTestAbs(Integer id)
    throws javax.ejb.FinderException;
    public abstract Set ejbSelectTestSqrt(Integer id)
    throws javax.ejb.FinderException;
    
    public Integer ejbCreate(Integer id) throws javax.ejb.CreateException {
        setId(id);
        return id;
    }
    
    public void ejbPostCreate(Integer id) {}
    
    public Integer ejbCreate(Integer id, String name, double value) 
            throws javax.ejb.CreateException {
        setId(id);
        setName(name);
        setValue(value);
        return id;
    }
    
    public void ejbPostCreate(Integer id, String name, double value) {}
    
    public void setEntityContext(javax.ejb.EntityContext entityContext) {
        this.entityContext = entityContext;
    }
    
    public void unsetEntityContext() throws javax.ejb.EJBException, java.rmi.RemoteException {
        this.entityContext = null;
    }
    
    public void ejbLoad() {}
    
    public void ejbStore() {}
    
    public void ejbActivate() {}
    
    public void ejbPassivate() {}
    
    public void ejbRemove() {}
}
